{{if validation_errors()}}
<ul class="message error">
    <li>{{validation_errors()}}</li>
</ul>
{{/if}}

<div class="clear"></div>
<form class="block-content form" id="simple_form" method="post" action="create">
    <h1>{{$category->lang->line('cat')}}</h1>
    <ul class="tabs js-tabs same-height">
        <li class="current"><a href="#tab-locales" title="Locales">{{$category->lang->line('current')}}</a></li>
        <li><a href="#tab-options" title="Options">{{$category->lang->line('options')}}</a></li>
        <li><a href="#tab-seo" title="Seo">{{$category->lang->line('seo')}}</a> </li>    
    </ul>
    <div class="tabs-content">

        <div id="tab-locales">
            {{if isset($category->id)}}{{form_hidden('id', $category->id)}}{{/if}}

            <fieldset class="grey-bg required">			
                <legend>{{$category->lang->line('required')}}</legend>
                <p>
                    <label for="simple-required">{{$category->lang->line('required')}}</label>
                    <input type="text" name="title" id="simple-required" value="{{if isset($category->title)}}{{$category->title}}{{/if}}" class="full-width">
                    {{form_error('title')}}
                </p>
            </fieldset>

            <fieldset>
                <legend>{{$category->lang->line('other_info')}}</legend>

                <p>
                    <label for="description">{{$category->lang->line('description')}}</label>
                    <textarea name="description" cols="10" class="full-width text-editor tinymcesimple">{{$category->description}}</textarea>
                </p>
                <p>
                    <label for="simple-select">{{$category->localize_label('parent_id')}}</label>
                    <select name="parent_id" id="simple-select" class="full-width">
                        {{html_options options=$category_list selected=$category->parent_id}}                            
                    </select>
                </p>
            </fieldset> 

        </div>
        <div id="tab-options">
            <p>
                <label for="simple-select">{{$category->lang->line('partner')}}</label>
                <select name="partner_id" id="simple-select" class="full-width">                    
                    {{html_options options=$partner->get_list() selected=$category->partner_id}}
                </select>
            </p>
            <p>
                <label for="simple-select">{{$category->lang->line('language')}}</label>
                <select name="lang_id" id="simple-select" class="full-width">
                    {{html_options options=$language->get_list() selected=$category->language_id}}
                </select>
            </p>

            <p>
                <label for="image">{{$category->lang->line('creator')}}</label>				
                <input type="text" name="creator_id" class="full-width" value="admin">				
            </p>

            <div class="columns">
                <div class="colx2-left">
                    <label for="content">{{$category->lang->line('simple-calendar')}}</label>
                    <span class="input-type-text margin-right relative">
                        <input type="text" name="simple-calendar" id="simple-calendar" value="">
                        <img src="{{base_url()}}data/templatesimages/icons/fugue/calendar-month.png" width="16" height="16">
                    </span> 

                </div>
                <p class="colx2-right">					
                    <label for="active">{{$category->lang->line('active')}}</label>
                    <input type="checkbox" name="active" id="simple-switch-on" value="1" checked="checked" class="switch">
                </p>
            </div>

            <div class="columns">
                <div class="colx2-left">
                    <label for="viewed">{{$category->lang->line('viewed')}} <b>1002</b></label>
                </div>
                <p class="colx2-right">					
                    <label for="editor">{{$category->lang->line('editor')}}<b>{{if isset($news->updated)}}{{$news->updated}}{{/if}}</b></label>
                </p>
            </div>

        </div>
        
        <div id="tab-seo">            
            <p>
                <label for="active">{{$category->lang->line('seo_title')}}</label>
                <input type="text" name="seo_title" class="full-width" value="{{if isset($category->seo_title)}}{{$category->seo_title}}{{/if}}">				
            </p>
            <p>
                <label for="active">{{$category->lang->line('keyword')}}</label>
                <input type="text" name="keyword" class="full-width" value="{{if isset($category->keyword)}}{{$category->keyword}}{{/if}}">				
            </p>
            <p>
                <label for="metadata">{{$category->lang->line('metadata')}}</label>
                <textarea name="metadata" cols="10" class="full-width text-editor tinymcesimple">{{if isset($category->metadata)}}{{$category->metadata}}{{/if}}</textarea>
            </p>
        </div>
        
        <br><br><br><br>
        <fieldset class="grey-bg no-margin">
            <legend>{{$category->lang->line('action')}}</legend>
            <p class="input-with-button">
                <button type="submit">{{$category->lang->line('save')}}</button>
            </p>
        </fieldset>	

    </div>
</form>
